package com.jinduplan.planmanager.mvp.model

import com.cxz.kotlin.baselibs.bean.BaseBean
import com.cxz.kotlin.baselibs.mvp.BaseModel
import com.cxz.kotlin.baselibs.utils.GsonHelper
import com.jinduplan.planmanager.bean.*
import com.jinduplan.planmanager.http.MainRetrofit
import com.jinduplan.planmanager.mvp.contract.MainContract
import com.jinduplan.planmanager.mvp.contract.MainFragmentContract
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.core.Observer

/**
 * @author admin
 * @date 2018/11/20
 * @desc
 */
class MainFragmentModel : BaseModel(), MainFragmentContract.Model {

    override fun getTips(): Observable<HttpResult<BaseBean>> {
        return MainRetrofit.service.getTips()
    }

    override fun getWeatherIp(): Observable<HttpResult<WeatherIpBean>> {
        return MainRetrofit.service.getWeahterIp()
    }

    override fun getWeather(adcode: String): Observable<HttpResult<WeatherBean>> {
        return MainRetrofit.service.getWeahter(adcode)
    }


}